<?php 
function DirDisply($data) { 
     
     $TrackDir=opendir("."); 
     
     while ($file = readdir($TrackDir)) { 
         
      if ($file != "." && $file != ".." && $file != "index.php") {
            print "<tr><td class='icon'><span class=".filetype($file).">".filetype($file)."</span></td>";
			print "<td><a href='$file' target=_blank>$file</a></td></tr>";

	 } 
         else {
             
                 
          }
       
     } 
     closedir($TrackDir); 

return $data; 
} 

?>

<html>
<head>
	<style>
		body { color:#000; background:#F9F9F9; font-family: Helvetica, Verdana, Arial, sans-serif;}
		body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,
		form,fieldset,legend,input,textarea,p,blockquote,th,td{ margin:0; padding:0; }
		table{ border-collapse:collapse; border-spacing:0; width:390px; background: #FFF; border-top:1px solid #EEE; }
		fieldset,img{ border:0; }
		address,caption,cite,code,dfn,em,strong,th,var{ font-style:normal; font-weight:normal; }
		li { padding: 0; margin: 0; list-style:none; }
		caption,th { text-align:left; }
		h1,h2,h3,h4,h5,h6{ font-size:100%; font-weight:normal; color: #999;}
		q:before,q:after{ content:"'"; }
		abbr,acronym { border:0; font-variant:normal; }
		sub { vertical-align:text-bottom; }
		input, textarea, select{ font-family:inherit; font-size:inherit; font-weight:inherit; }
		
		#maincontainer { margin:20px 10px 0 0; width:543px; padding:10px;}
		h1 { background: url( http://prod.pitchmedia.co.nz/viewer/pm_logo.gif) no-repeat; display: block; height:70px; width: 123px; float: right; text-indent: -9999px;}
		h2 { clear:both; padding-right: 10px; text-align: right;}
		ul { float:left; width: 143px; }
		td { padding: 5px; line-height: 16px;}
		.icon { width: 20px; color:#BBB; }
		span { display: block; width:16px; height:16px; }
		.file { text-indent: -9999px; background: url(http://prod.pitchmedia.co.nz/viewer/icon_file.gif) no-repeat 0 0; }
		.dir { text-indent: -9999px; background: url(http://prod.pitchmedia.co.nz/viewer/icon_folder.gif) no-repeat 0 0; }
		tr { border-bottom: 1px solid #EEE; }
		.table { width:390px; margin-left:143px; background: #FFF; border-left: 3px solid #023b5b; min-height: 70px; padding: 5px;}
		a:hover { text-decoration: none; }
	</style>
</head>
<body>
	<div id="maincontainer">
		<ul>
			<li>
				<h1>Pitch Media</h1>
			</li>
			<li>
				<h2>PVK002</h2>
			</li>
		</ul>
		<div class="table">
			<table>
				<? 
				@ DirDisply($data); 
				?>
			</table>
		</div>
	</div>
</body>
<html>